package cn.example.viewpager;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;


public class MyFragmentPagerAdpater extends FragmentPagerAdapter {

    private List<Fragment> flist;
    private List<String> titleList;

    public MyFragmentPagerAdpater(FragmentManager fm,List<Fragment> arg1,List<String> arg2) {
        super(fm);
        this.flist=arg1;
        this.titleList=arg2;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titleList.get(position);
    }

    @Override
    public Fragment getItem(int position) {
        return flist.get(position);
    }

    @Override
    public int getCount() {
        return flist.size();
    }
}
